<template>
  <el-dialog ref="dislogRef" :visible.sync="dialogVisible" lock-scroll width="60%" height="50%">
    <div slot="title" class="header_title">
      <span class="title_span">邀请分享</span>
    </div>
    <div class="content_div">
      <div class="button_div">
        <el-button
          @click="onButton(index)"
          v-for="(item, index) in buttonData"
          :key="index"
          :type="item.state ? 'primary' : ''"
          >{{ item.name }}</el-button
        >
      </div>
      <div v-show="buttonData[0].state" class="staff_div">
        <div class="operation">
          <div>
            <p>员工手机<span>*</span></p>
            <input type="text" v-model="queryData.ygsj" />
          </div>
          <div>
            <p>员工姓名</p>
            <input type="text" v-model="queryData.ygxx" />
          </div>
          <div>
            <p>选择权限</p>
            <el-select placeholder="" v-model="queryData.xzqx">
              <el-option v-for="item in xzqxOptions" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
            <p class="tips_style">设置权限</p>
          </div>
          <div>
            <p>加入公司</p>
            <el-select placeholder="" v-model="queryData.jrgs">
              <el-option v-for="item in jrgsOptions" :key="item.value" :label="item.label" :value="item.value">
              </el-option>
            </el-select>
          </div>
        </div>
        <div class="course">
          <div>
            <p>二维码邀请</p>
            <div>
              <img src="" alt="" />
            </div>
            <span>手机扫码分享给好友</span>
          </div>
          <p>或</p>
          <div>
            <p>发送链接邀请</p>
            <div>
              <textarea disabled name="" id="" cols="30" rows="10">
https://www.iconfont.cn/search/index?searchType</textarea
              >
            </div>
            <el-button type="primary">复制链接</el-button>
          </div>
          <p>或</p>
          <div>
            <p>短信邀请</p>
            <div class="div_style">
              <p>发送</p>
              <p>短信</p>
            </div>
            <span style="display: block; height: 60px"></span>
          </div>
        </div>
      </div>
      <div v-show="buttonData[1].state" class="customer_div">
        <div class="picture"></div>
        <div class="words">
          <p>分享客户注册使用，即可享受更多优惠政策，分享越多，优惠越大</p>
          <el-button type="primary">复制链接</el-button>
        </div>
      </div>
    </div>
  </el-dialog>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  name: 'BasicInformation',
  computed: {
    ...mapGetters(['name']),
  },
  created() {},
  data() {
    return {
      dialogVisible: false,
      buttonData: [
        {
          name: '邀请员工',
          state: true,
        },
        {
          name: '分享客户',
          state: false,
        },
      ],
      // 选择权限
      xzqxOptions: [
        {
          value: '销售员',
          label: '销售员',
        },
        {
          value: '销售员一',
          label: '销售员一',
        },
      ],
      // 加入公司
      jrgsOptions: [
        {
          value: '郑州象过河软件技术有限公司',
          label: '郑州象过河软件技术有限公司',
        },
        {
          value: '郑州小飞象科技有限公司',
          label: '郑州小飞象科技有限公司',
        },
      ],
      queryData: {
        ygsj: '',
        ygxx: '',
        xzqx: '',
        jrgs: '',
      },
    }
  },
  methods: {
    // 点击切换按钮
    onButton(index) {
      this.buttonData.forEach((item, i) => {
        if (index == i) {
          item.state = true
        } else {
          item.state = false
        }
      })
    },
  },
}
</script>

<style lang="scss" scoped>
::v-deep .el-dialog {
  width: 100%;
  .el-dialog__body {
    padding: 0;
  }
  .el-dialog__header {
    width: 100%;
    height: 0.937559rem;
    box-sizing: border-box;
    padding: 0 0.187512rem 0 0.281268rem;
    border-bottom: 1px solid #eeeeee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    .el-dialog__headerbtn {
      position: static;
      .el-icon-close {
        color: #999;
        font-size: 0.48753rem;
      }
    }
  }
  .header_title {
    width: 100%;
    display: flex;
    align-items: center;
    .title_span {
      white-space: nowrap;
      font-size: 0.300019rem;
      color: #666;
      font-weight: 600;
    }
  }
}
.content_div {
  width: 100%;
  height: 65vh;
  background: #fff;
  box-sizing: border-box;
  padding: 0 0.281268rem;
  .button_div {
    width: 100%;
    height: 1.12507rem;
    display: flex;
    align-items: center;
    justify-content: center;
    ::v-deep .el-button {
      width: 1.312582rem;
      height: 0.562535rem;
      display: flex;
      align-items: center;
      justify-content: center;
      span {
        font-size: 0.225014rem;
        font-family: PingFang SC;
        font-weight: 400;
        color: #666;
      }
      &:first-child {
        margin-right: 0.131258rem;
      }
      &:last-child {
        margin-left: 0.131258rem;
      }
    }
    ::v-deep .el-button--primary {
      background-color: #1b94fb;
      border-color: #1b94fb;
      span {
        color: #fff;
      }
    }
  }
  .staff_div {
    width: 100%;
    height: calc(100% - 1.12507rem);
    .operation {
      width: 100%;
      height: 2.925183rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      > div {
        display: flex;
        align-items: center;
        height: 0.562535rem;
        p {
          margin: 0;
          width: 1.312582rem;
          font-size: 0.225014rem;
          font-family: PingFang SC;
          font-weight: 400;
          color: #666666;
          span {
            color: #ff0000;
          }
        }
        input {
          width: 5.062816rem;
          height: 0.562535rem;
          background: #ffffff;
          border: 1px solid #e3e3e3;
          opacity: 1;
          border-radius: 0.075005rem;
          font-size: 0.225014rem;
          color: #666;
          box-sizing: border-box;
          padding: 0 0.150009rem;
          &:focus {
            outline: none;
            border-color: #1890ff;
          }
        }
        ::v-deep .el-select {
          width: 5.062816rem;
          height: 0.562535rem;
          box-sizing: border-box;
          border-radius: 0.075005rem;
          .el-input {
            .el-input__inner {
              height: 0.562535rem;
              border-color: #e3e3e3;
              font-size: 0.225014rem;
              padding-left: 0.150009rem;
            }
            .el-input__suffix {
              height: 0.562535rem;
              display: flex;
              align-items: center;
            }
          }
        }
        .tips_style {
          color: #fd6c21;
          margin-left: 0.187512rem;
        }
      }
    }
    .course {
      width: 100%;
      height: calc(100% - 2.925183rem);
      box-sizing: border-box;
      padding: 0.562535rem 0;
      display: flex;
      align-items: center;
      justify-content: space-between;
      > div {
        width: 4.031502rem;
        height: 100%;
        box-sizing: border-box;
        padding: 0 0.562535rem;
        border: 1px solid #cbced3;
        border-radius: 0.187512rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: space-between;
        > p {
          font-size: 0.262516rem;
          font-family: PingFang SC;
          font-weight: 600;
          color: #666666;
        }
        > div {
          width: 100%;
          flex: 1;
          textarea {
            width: 100%;
            height: 1.687605rem;
            background: #f0f2f5;
            border: 1px solid #cbced3;
            box-sizing: border-box;
            padding: 0.187512rem 0.281268rem;
          }
        }
        .div_style {
          width: 1.500094rem;
          background: #20c9ac;
          display: flex;
          align-items: center;
          flex-direction: column;
          justify-content: center;
          border-radius: 5px;
          > p {
            margin: 0.093756rem;
            font-size: 0.262516rem;
            font-family: PingFang SC;
            font-weight: 400;
            color: #ffffff;
          }
        }
        > span {
          line-height: 0.562535rem;
          font-size: 0.225014rem;
          font-family: PingFang SC;
          font-weight: 400;
          color: #666666;
        }
        ::v-deep .el-button {
          width: 1.500094rem;
          height: 0.562535rem;
          background: #20c9ac;
          border-radius: 0.093756rem;
          border: none;
          display: flex;
          align-items: center;
          justify-content: center;
          margin: 0.187512rem;
        }
      }
    }
  }
  .customer_div {
    width: 100%;
    height: calc(100% - 1.12507rem);
    box-sizing: border-box;
    padding: 0 2.062629rem;
    .picture {
      width: 100%;
      height: 5.062816rem;
      background: red;
    }
    .words {
      width: 100%;
      height: 0.562535rem;
      margin-top: .562535rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
      > p {
        margin: 0;
        font-size: 0.225rem;
        font-family: PingFang SC;
        color: #666;
      }
      ::v-deep .el-button {
        width: 1.500094rem;
        height: 0.562535rem;
        background: #20c9ac;
        border-radius: 0.093756rem;
        border: none;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }
  }
}
</style>